package com.controller.experiment;


import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import com.pojo.User;

@Controller
public class indexcontroller {
    @RequestMapping("/add")
    public String index(int a, int b, Model model){
        int res=a+b;
        model.addAttribute("msg","结果为"+res);
        return  "index";
    }
    @RequestMapping("/user")
    public  String getuser(User user, Model model){
        System.out.println(user.getUsername());
        model.addAttribute("msg","结果为"+user.getUsername());
        return  "index";
    };
}
